home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / archivers / xfd / developer / include / amigae / emodules / libraries / xfdmaster.e next >
Text File  |  1999-05-17  |  23KB  |  496 lines

  1. /*
  2. **      $VER: xfdmaster.h 38.4 (02.11.98)
  3. **
  4. **      Copyright © 1994-98 by Georg Hörmann, Dirk Stöcker
  5. **      All Rights Reserved.
  6. **
  7. **      Translated to E by Sven Steiniger.
  8. */
  9.  
  10. OPT MODULE
  11. OPT PREPROCESS
  12. OPT EXPORT
  13.  
  14. MODULE 'exec/libraries', 'exec/execbase',
  15.        'dos/dosextens'
  16.  
  17. /*********************
  18. *                    *
  19. *    Library Base    *
  20. *                    *
  21. *********************/
  22.  
  23. OBJECT xfdMasterBase
  24.   libNode:lib
  25.   xfdm_SegList:LONG                       /* PRIVATE! */
  26.   xfdm_DosBase:PTR TO doslibrary          /* May be used for I/O etc. */
  27.   xfdm_FirstSlave:PTR TO xfdSlave         /* List of available slaves */
  28.   xfdm_FirstForeMan:PTR TO xfdForeMan     /* PRIVATE! */
  29.   xfdm_MinBufferSize:LONG                 /* (V36) Min. BufSize for xfdRecogBuffer() */
  30.   xfdm_MinLinkerSize:LONG                 /* (V36) Min. BufSize for xfdRecogLinker() */
  31.   xfdm_ExecBase:PTR TO execbase           /* (V38.2) Cached for fast access */
  32. ENDOBJECT
  33.  
  34.  
  35. CONST XFDM_VERSION              = 38      /* for OpenLibrary() */
  36. #define XFDM_NAME 'xfdmaster.library'
  37.  
  38. /***************************
  39. *                          *
  40. *    Object Types (V36)    *
  41. *                          *
  42. ***************************/
  43.  
  44. CONST XFDOBJ_BUFFERINFO         = 1       /* xfdBufferInfo structure */
  45. CONST XFDOBJ_SEGMENTINFO        = 2       /* xfdSegmentInfo structure */
  46. CONST XFDOBJ_LINKERINFO         = 3       /* xfdLinkerInfo structure */
  47. CONST XFDOBJ_SCANNODE           = 4       /* (V37) xfdScanNode structure */
  48. CONST XFDOBJ_SCANHOOK           = 5       /* (V37) xfdScanHook structure */
  49. CONST XFDOBJ_MAX                = 5       /* PRIVATE! */
  50.  
  51. /********************
  52. *                   *
  53. *    Buffer Info    *
  54. *                   *
  55. ********************/
  56.  
  57. OBJECT xfdBufferInfo
  58.   xfdbi_SourceBuffer:PTR TO CHAR          /* Pointer to source buffer */
  59.   xfdbi_SourceBufLen:LONG                 /* Length of source buffer */
  60.   xfdbi_Slave:PTR TO xfdSlave             /* PRIVATE! */
  61.   xfdbi_PackerName:PTR TO CHAR            /* Name of recognized packer */
  62.   xfdbi_PackerFlags:INT                   /* Flags for recognized packer */
  63.   xfdbi_Error:INT                         /* Error return code */
  64.   xfdbi_TargetBuffer:PTR TO CHAR          /* Pointer to target buffer */
  65.   xfdbi_TargetBufMemType:LONG             /* Memtype of target buffer */
  66.   xfdbi_TargetBufLen:LONG                 /* Full length of buffer */
  67.   xfdbi_TargetBufSaveLen:LONG             /* Used length of buffer */
  68.   xfdbi_DecrAddress:LONG                  /* Address to load decrunched file */
  69.   xfdbi_JmpAddress:LONG                   /* Address to jump in file */
  70.   xfdbi_Special:PTR TO CHAR               /* Special decrunch info (eg. password) */
  71.   xfdbi_Flags:INT                         /* (V37) Flags to influence recog/decr */
  72.   xfdbi_Reserved0:INT                     /* (V38) PRIVATE! */
  73.   xfdbi_MinTargetLen:LONG                 /* (V38) Required length of target buffer */
  74.   xfdbi_FinalTargetLen:LONG               /* (V38) Final length of decrunched file */
  75.   xfdbi_UserTargetBuf:PTR TO CHAR         /* (V38) Target buffer allocated by user */
  76.   xfdbi_UserTargetBufLen:LONG             /* (V38) Target buffer length */
  77. ENDOBJECT
  78.  
  79. /* Max. length of special info */
  80. #define xfdbi_MaxSpecialLen xfdbi_Error
  81.  
  82.  
  83. /*********************
  84. *                    *
  85. *    Segment Info    *
  86. *                    *
  87. *********************/
  88.  
  89. OBJECT xfdSegmentInfo
  90.   xfdsi_SegList:LONG                      /* BPTR to segment list */
  91.   xfdsi_Slave:PTR TO xfdSlave             /* PRIVATE! */
  92.   xfdsi_PackerName:PTR TO CHAR            /* Name of recognized packer */
  93.   xfdsi_PackerFlags:INT                   /* Flags for recognized packer */
  94.   xfdsi_Error:INT                         /* Error return code */
  95.   xfdsi_Special:PTR TO CHAR               /* Special decrunch info (eg. password) */
  96.   xfdsi_RelMode:INT                       /* (V34) Relocation mode */
  97.   xfdsi_Flags:INT                         /* (V37) Flags to influence recog/decr */
  98. ENDOBJECT
  99.  
  100. /* Max. length of special info */
  101. #define xfdsi_MaxSpecialLen xfdsi_Error
  102.  
  103.  
  104. /**************************
  105. *                         *
  106. *    Linker Info (V36)    *
  107. *                         *
  108. **************************/
  109.  
  110. OBJECT xfdLinkerInfo
  111.   xfdli_Buffer:PTR TO CHAR                /* Pointer to buffer */
  112.   xfdli_BufLen:LONG                       /* Length of buffer */
  113.   xfdli_LinkerName:PTR TO CHAR            /* Name of recognized linker */
  114.   xfdli_Unlink:PTR TO CHAR                /* PRIVATE! */
  115.   xfdli_Reserved:INT                      /* Set to NULL */
  116.   xfdli_Error:INT                         /* Error return code */
  117.   xfdli_Hunk1:LONG                        /* PRIVATE! */
  118.   xfdli_Hunk2:LONG                        /* PRIVATE! */
  119.   xfdli_Amount1:LONG                      /* PRIVATE! */
  120.   xfdli_Amount2:LONG                      /* PRIVATE! */
  121.   xfdli_Save1:PTR TO CHAR                 /* Pointer to first unlinked file */
  122.   xfdli_Save2:PTR TO CHAR                 /* Pointer to second unlinked file */
  123.   xfdli_SaveLen1:LONG                     /* Length of first unlinked file */
  124.   xfdli_SaveLen2:LONG                     /* Length of second unlinked file */
  125. ENDOBJECT
  126.  
  127. /************************
  128. *                       *
  129. *    Scan Node (V37)    *
  130. *                       *
  131. ************************/
  132.  
  133. OBJECT xfdScanNode
  134.   xfdsn_Next:PTR TO xfdScanNode           /* Pointer to next xfdScanNode or NULL */
  135.   xfdsn_Save:PTR TO CHAR                  /* Pointer to data */
  136.   xfdsn_SaveLen:LONG                      /* Length of data */
  137.   xfdsn_PackerName:PTR TO CHAR            /* Name of recognized packer */
  138.   xfdsn_PackerFlags:INT                   /* Flags for recognized packer */
  139. ENDOBJECT
  140.  
  141. /************************
  142. *                       *
  143. *    Scan Hook (V37)    *
  144. *                       *
  145. ************************/
  146.  
  147. OBJECT xfdScanHook
  148.   xfdsh_Entry:LONG                        /* Entrypoint of hook code (BOOL (*)()) */
  149.   xfdsh_Data:PTR TO CHAR                  /* Private data of hook */
  150.   xfdsh_ToDo:LONG                         /* Bytes still to scan (READ ONLY) */
  151.   xfdsh_ScanNode:LONG                     /* Found data right now (or NULL) (READ ONLY) */
  152. ENDOBJECT
  153.  
  154. /********************
  155. *                   *
  156. *    Error Codes    *
  157. *                   *
  158. ********************/
  159.  
  160. CONST XFDERR_OK                 = $0000   /* No errors */
  161.  
  162. CONST XFDERR_NOMEMORY           = $0001   /* Error allocating memory */
  163. CONST XFDERR_NOSLAVE            = $0002   /* No slave entry in info structure */
  164. CONST XFDERR_NOTSUPPORTED       = $0003   /* Slave doesn't support called function */
  165. CONST XFDERR_UNKNOWN            = $0004   /* Unknown file */
  166. CONST XFDERR_NOSOURCE           = $0005   /* No sourcebuffer/seglist specified */
  167. CONST XFDERR_WRONGPASSWORD      = $0006   /* Wrong password for decrunching */
  168. CONST XFDERR_BADHUNK            = $0007   /* Bad hunk structure */
  169. CONST XFDERR_CORRUPTEDDATA      = $0008   /* Crunched data is corrupted */
  170. CONST XFDERR_MISSINGRESOURCE    = $0009   /* (V34) Missing resource (eg. library) */
  171. CONST XFDERR_WRONGKEY           = $000a   /* (V35) Wrong 16/32 bit key */
  172. CONST XFDERR_BETTERCPU          = $000b   /* (V37) Better CPU required */
  173. CONST XFDERR_HOOKBREAK          = $000c   /* (V37) Hook caused break */
  174. CONST XFDERR_DOSERROR           = $000d   /* (V37) Dos error */
  175. CONST XFDERR_NOTARGET           = $000e   /* (V38) No user target given */
  176. CONST XFDERR_TARGETTOOSMALL     = $000f   /* (V38) User target is too small */
  177. CONST XFDERR_TARGETNOTSUPPORTED = $0010   /* (V38) User target not supported */
  178.  
  179. CONST XFDERR_UNDEFINEDHUNK      = $1000   /* (V34) Undefined hunk type */
  180. CONST XFDERR_NOHUNKHEADER       = $1001   /* (V34) File is not executable */
  181. CONST XFDERR_BADEXTTYPE         = $1002   /* (V34) Bad hunk_ext type */
  182. CONST XFDERR_BUFFERTRUNCATED    = $1003   /* (V34) Unexpected end of file */
  183. CONST XFDERR_WRONGHUNKAMOUNT    = $1004   /* (V34) Wrong amount of hunks */
  184. CONST XFDERR_NOOVERLAYS         = $1005   /* (V36) Overlays not allowed */
  185.  
  186. CONST XFDERR_UNSUPPORTEDHUNK    = $2000   /* (V34) Hunk type not supported */
  187. CONST XFDERR_BADRELMODE         = $2001   /* (V34) Unknown XFDREL_#? mode */
  188.  
  189. /